package com.litblue.api.fallback;


import com.litblue.api.client.GetArtWorkClient;
import com.litblue.api.client.GetUserInfoClient;
import com.litblue.starter.pojo.artwork.query.LitArtworkInfoQuery;
import com.litblue.starter.pojo.user.domian.LitUserInfo;
import lombok.extern.slf4j.Slf4j;
import org.springframework.cloud.openfeign.FallbackFactory;

@Slf4j
public class GetUserInfoClientFallbackFactory implements FallbackFactory<GetUserInfoClient> {

    @Override
    public GetUserInfoClient create(Throwable cause) {
//一定要重写失败方法不然nullpoint
        return new GetUserInfoClient() {
            @Override
            public LitUserInfo queryUserInfo(Long id) {
                log.info("用户信息查询失败！",cause);
                return null;
            }
        };
    }
}